package com.example.springretry.controller;
import com.example.springretry.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA2022.3.2
 * @Author: Tenghw
 * @Date: 2023/03/19  15:01
 * @Description: springRetry重试机制
 */
@Slf4j
@RestController
public class PayController {

    @Autowired
    PayService payService;

    /**
     * 功能描述：springRetry重试机制demo
     * @param code
     * @return String
     */
    @GetMapping("/addCode/{code}")
    public String addCode(@PathVariable int code) throws Exception {
        return payService.test(code);
    }
}
